﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>MicrosoftAjax</title>
    <script src="~/Scripts/jquery-1.8.2.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
    <script type="text/javascript">
        function afterSuccess(data) {
            //alert(data);
        }
    </script>
</head>
<body>
    <div>
        @using (Ajax.BeginForm("GetDate", "Ajax", new AjaxOptions(){Confirm  ="您是否要提交吗？",HttpMethod = "Post",InsertionMode = InsertionMode.InsertAfter,UpdateTargetId = "result",OnSuccess="afterSuccess",LoadingElementId = "loading"}))
        {
            <div>
                用户名：<input type="text" name="UserName" /><br />
                密码：<input type="text" name="Pwd"/><br />
                <input type="submit" value="提交"/>
            </div>
        }
        
        <div id="result">

        </div>
        
        <div id="loading" style="display:none">
            <img src="~/Content/ico_loading2.gif" />
        </div>
    </div>
</body>
</html>
